<?php include './application/views/common/zhs_header.php';?>
<div class="newtitle-box">
  <div class="newtitle w">
    <span class="invlist_title">您现在的位置：<a href="index.html">首页</a>><a class="red" href="#">用户登录</a></span><p> QQ、新浪 <a href="/reg.html">快速注册</a> | 已有帐号，<a class="red" href="#">立即登录</a></p>
  </div>
  </div>
 <form id="login_form">
 <input type="hidden" name="act" value="login" />
  <input type="hidden" name="last_url" value="<?PHP echo $_SERVER['HTTP_REFERER'];?>" />
<div class="login_box w">
    <div class="login_bd">
        <ul>
          <li class="inpli1">
          	<input class="inptl_1" name="usernm" id="username" type="text"
				value="手机号/邮箱" onfocus="clearText(this);"
				onblur="setText(this,'手机号/邮箱');" maxlength="28">
          </li>
          <li class="inpli2">
          <input class="inptl_1" id="txt" type="text" value="请输入密码"> 
          <input class="inptl_1"  name="password" id="pwd" style="display:none;" type="password" maxlength="20"> 
          </li>
         <li>
			<input class="inptl_6" name="captcha" id="captcha" type="text" maxlength="6" />
            <span><img src="/yanzheng" id="imgCode" onclick="changeImage();"  style="cursor: pointer;" /></span>
		</li>
          <li><a class="logbtn" href="javascript:void(0);" onclick="login_submit();">登录</a><a class="mt" href="/password/zhs_forget">忘记密码？</a><a class="mt">|</a><a class="mt" href="/reg.html">注册用户</a></li>
          <li><input style="border:1px #fff solid;" class="ml" type="checkbox" value="1" name="savepwd"><a class="mt" href="javascript:;">记住密码</a><span>使用公用电脑勿勾选</span></li><!--
          <li><span class="ml">您还可以使用合作账号登录</span><a href="#" class="sin"></a><a href="#" class="sin2"></a></li>
        --></ul>
    </div>
    </div>
  </form>
    
<script type="text/javascript">
$(function () {
	var inp = $('#captcha');
	inp.keypress(function (e) { 
	    var key = e.which; 
	    if (key == 13) {
	    	login_submit();
	    }
	});
});
function clearText(input){
	if(input.value=='手机号/邮箱'){
		input.value="";
	}
}
function setText(input,txt){
	if(input.value==''){
		input.value=txt;
	}
}

function login_submit(){
	
	var options = {
		url : '/login',
		dataType: "json",
		type:"post",
		success : function(ret) {
			if(ret.msg==''){
				location=ret.data.url;
			}else{
				$('#dialog').dialog({
					modal:true,
					title:'系统提示',
					buttons:{"确定":function(){$(this).dialog("close");}},
					close: function() {
						document.getElementById("imgCode").src = "/yanzheng/index/?" + Math.random();
					}
				}); 
				$("#msg").html(ret.msg);
			}
		}
	};
	$("#login_form").ajaxSubmit(options);
	return false;
}

function changeImage() {
	document.getElementById("imgCode").src = "/yanzheng/index/?" + Math.random();
}

</script>
<?php include './application/views/common/zhs_footer.php';?>
<?php include './application/views/common/zhs_right.php';?>

